﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Cabinet.Master" Inherits="System.Web.Mvc.ViewPage<nsadv.Statistic.Web.ViewModels.UsersModel>" %>
<%@ Import Namespace="nsadv.Statistic.Web.ViewModels" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CabinetContent" runat="server">
	<%: Html.ValidationSummary() %>
	<table class="bannerstbl" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
			<td>
				Пользователь
			</td>
			<td>
				Тип
			</td>
			<td>
				Рекламная площадка
			</td>
			<td>
				Рекламодатель
			</td>
			<td>
			</td>
			</tr>
		</thead>
		<tbody>
		<% foreach (var user in Model.Users)
	 { %>
		<tr>
			<td>
				<%: user.Name %>
			</td>
			<td>
				<%: UserModel.UserRoleNamesMap(user.Role)%>
			</td>
			<td>
				<%: user.Place == null ? "-" : user.Place.Name%>
			</td>
			<td>
				<%: user.Advertiser == null ? "-" : user.Advertiser.Name%>
			</td>
			<td>
				<%: Html.ActionLink("Изменить", "EditUser", new { id = user.Id }) %>
<%--				|
				<%: Html.ActionLink("Просмотр", "Details", new { /* id=item.PrimaryKey */ })%>
--%>				|
				<%: Html.ActionLink("Удалить", "DeleteUser", new { id = user.Id })%>
			</td>
		</tr>
		<% } %>
		</tbody>
	</table>
	<p>
		<%: Html.ActionLink("Создать", "CreateUser") %>
	</p>
</asp:Content>
